# encoding: UTF-8
'''
Created on 2013-11-16

@author: Ben
资源区详细数据
'''

class BuildingVO:
    
    #建筑名
    name = ""
    #位置
    pos = 0
    #是否有政务事件
    hasEvent = False
    #编号
    id = 0
    #建筑等级
    lv = 0
    
    def __init__(self, data):
        if 'name' in data:
            self.name = data['name']
        if 'pos' in data:
            self.pos = data['pos']
        if 'hasEvent' in data:
            self.hasEvent = data['hasEvent']
        if 'id' in data:
            self.id = data['id']
        if 'lv' in data:
            self.lv = data['lv']

class ResourceRegionDetailVO:
    
    #建筑列表
    buildingList = []
    
    def __init__(self, data):
        #需要重新绑定，否则为类静态变量
        self.buildingList = []
        if 'buildings' in data:
            for buildingObj in data['buildings']:
                buildingVO = BuildingVO(buildingObj)
                self.buildingList.append(buildingVO)
                
'''
政务事件数据
'''
class PoliticalEventVO:
    
    #最大名忠
    peopleLoyalMax = 0
    #当前名忠
    peopleLoyal = 0
    #当前政务事件数量
    currentEventNum = 0
    #选项1类型
    type1 = 0
    #选项1消耗金币
    goldConsume1 = 0
    #选项2类型
    type2 = 0
    #选项2消耗金币
    goldConsume2 = 0
    
    def __init__(self, data):
        if 'peopleLoyalMax' in data:
            self.peopleLoyalMax = data['peopleLoyalMax']
        if 'peopleLoyal' in data:
            self.peopleLoyal = data['peopleLoyal']
        if 'currentEventNum' in data:
            self.currentEventNum = data['currentEventNum']
        if 'type1' in data:
            self.type1 = data['type1']
        if 'goldConsume1' in data:
            self.goldConsume1 = data['goldConsume1']
        if 'type2' in data:
            self.type2 = data['type2']
        if 'goldConsume2' in data:
            self.goldConsume2 = data['goldConsume2']